import Vue from 'vue'
import Router from 'vue-router'

import Layout from '@/components/Layout'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '',
      redirect: '/dashboard/admin'
    },
    /* 首页 */
    {
      path: '/dashboard',
      name: 'Dashboard',
      component: Layout,
      meta: {
        title: '首页',
        indexPage: true
      },
      redirect: '/dashboard/admin',
      children: [
        /* admin */
        {
          path: 'admin',
          name: 'AdminIndex',
          component: () => import('@/views/dashboard/admin'),
          meta: {
            title: 'Admin',
            showInBreadcrumb: false
          }
        }
      ]
    },
    {
      path: '/subject_analysis',
      name: 'subject_analysis',
      component: Layout,
      meta: {
        title: '选科分析',
        indexPage: true
      },
      children: [
        {
          path: 'best_subject_analysis',
          name: 'best_subject_analysis',
          component: () => import('@/views/subject_analysis/best_subject_analysis'),
          meta: {
            title: '全市学校优势学科分析',
            showInBreadcrumb: true
          }
        },
        {
          path: 'subject_combine',
          name: 'subject_combine',
          component: () => import('@/views/subject_analysis/subject_combine'),
          meta: {
            title: '全市选科组合分析',
            showInBreadcrumb: true
          }
        },
        {
          path: 'subject_change',
          name: 'subject_change',
          component: () => import('@/views/subject_analysis/subject_change'),
          meta: {
            title: '全市选科意向变更统计',
            showInBreadcrumb: true
          }
        },
        {
          path: 'subject_change_detail',
          name: 'subject_change_detail',
          component: () => import('@/views/subject_analysis/subject_change_detail'),
          meta: {
            title: '全市选科意向变更统计-详情',
            showInBreadcrumb: true
          }
        },
        {
          path: 'subject_combine_detail',
          name: 'subject_combine_detail',
          component: () => import('@/views/subject_analysis/subject_combine_detail'),
          meta: {
            title: '全市选科组合分析-详情',
            showInBreadcrumb: true
          }
        },
        {
          path: 'school_combine',
          name: 'school_combine',
          component: () => import('@/views/subject_analysis/school_combine'),
          meta: {
            title: '校级选科综合分析',
            showInBreadcrumb: true
          }
        },
        {
          path: 'subject_course_analysis',
          name: 'subject_course_analysis',
          component: () => import('@/views/course_analysis/subject_course_analysis'),
          meta: {
            title: '市级科目课时分析',
            showInBreadcrumb: true
          }
        }
      ]
    },
    {
      path: '/course_analysis',
      name: 'course_analysis',
      component: Layout,
      meta: {
        title: '选科分析',
        indexPage: true
      },
      children: [
        {
          path: 'subject_course_analysis',
          name: 'subject_course_analysis',
          component: () => import('@/views/course_analysis/subject_course_analysis'),
          meta: {
            title: '市级科目课时分析',
            showInBreadcrumb: true
          }
        },
        {
          path: 'teacher_power_analysis',
          name: 'teacher_power_analysis',
          component: () => import('@/views/course_analysis/teacher_power_analysis'),
          meta: {
            title: '全市师资力量统计',
            showInBreadcrumb: true
          }
        },
        {
          path: 'teacher_student_analysis',
          name: 'teacher_student_analysis',
          component: () => import('@/views/course_analysis/teacher_student_analysis'),
          meta: {
            title: '全市师生配比分析',
            showInBreadcrumb: true
          }
        },
        {
          path: 'geomap',
          name: 'geomap',
          component: () => import('@/views/course_analysis/geomap'),
          meta: {
            title: '全市师生配比分析',
            showInBreadcrumb: true
          }
        }
      ]
    }
  ]
})
